<template>
  <ui-popup
    @onCancel="onCancel"
    @onSubmit="onSubmit"
    title="表单"
    width="80%"
    isDrag
    isConfirm
  >
    <div>
      <span>基础用法</span>
    </div>
  </ui-popup>
</template>
<script>
export default {
  name: "editOperation",
  props: {
    params: {
      type: Object,
      default() {
        return {};
      }
    }
  },
  data() {
    return {
      //提交的参数
      updateForm: {
        name: '',
        phone: '',
        operationCode: '',
      },
      rules: {
        name: [
          { required: true, message: '请输入功能名称' }
        ],
        phone: [
          { required: true, message: '请输入功能类型' }
        ],
        operationCode: [
          { required: true, message: '请输入功能编码' }
        ],
      }
    }
  },
  created() {
    if (this.params.isEdit) {
      Object.assign(this.updateForm, this.params)
    }
  },
  methods: {
    onCancel() {
      this.reject();
    },
    onSubmit() {
      let sendData = Object.assign({}, this.$store.getters, this.updateForm);
      this.resolve(sendData);
    },
  }
};
</script>
